// StringCaculateCommand.cpp: implementation of the StringCaculateCommand class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "StringCaculateCommand.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

StringCaculateCommand::StringCaculateCommand(PartString* pString)
{
	ASSERT(pString);
	m_pString = pString;
}

StringCaculateCommand::~StringCaculateCommand()
{

}

BOOL StringCaculateCommand::Execute()
{
	FunctionObject* pFunction = NULL;
	pFunction = m_pString->GetFunction(FunctionObject::eSELSPRING);
	if(pFunction != NULL)
	{
		if(!pFunction->Execute())
			return FALSE;
	}

	pFunction = m_pString->GetFunction(FunctionObject::eSELCONSTSPRING);
	if(pFunction != NULL)
	{
		if(!pFunction->Execute())
			return FALSE;
	}

	return TRUE;
}